<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:sec="http://www.springframework.org/security/facelets/tags">

<f:loadBundle basename="fr.bugtracker.commun.messages.Messages_ihm_fr_FR" var="msg" />

<h:head>
	<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=8" />
	<title><ui:insert name="pageTitle">#{msg['ihm.application.titre']}</ui:insert></title>
	<link rel="shortcut icon" type="image/x-icon" href="#{request.contextPath}/resources/images/icones/favicon.ico" />
	<link href="${facesContext.externalContext.requestContextPath}/resources/css/application.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="${facesContext.externalContext.requestContextPath}/resources/css/primefaces-component.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="${facesContext.externalContext.requestContextPath}/resources/css/icones.css" media="screen" rel="stylesheet" type="text/css" />
</h:head>

<body>
	<sec:isAuthenticated>
		<h:form>
			<p:poll widgetVar="pollSession" autoStart="true" global="false" interval="#{facesContext.externalContext.sessionMaxInactiveInterval + 1}" oncomplete="dialogExpirationSession.show()" />
		</h:form>

		<p:ajaxStatus oncomplete="pollSession.stop(); pollSession.start()" />
	</sec:isAuthenticated>

	<p:layout fullPage="true">

		<p:layoutUnit position="north" gutter="0">

			<p:growl autoUpdate="true" escape="false" />
			<div id="header">
				<ui:include src="header.xhtml" />
			</div>
			<sec:isAuthenticated>
				<div id="menu">
					<ui:include src="menu.xhtml" />
				</div>
			</sec:isAuthenticated>
				<p:separator />
		</p:layoutUnit>

		<p:layoutUnit position="center" gutter="0">
			<div id="content">
				<ui:insert name="content" />
			</div>
		</p:layoutUnit>
	</p:layout>

	<script src="${facesContext.externalContext.requestContextPath}/resources/js/application.js" type="text/javascript" />

	<ui:insert name="dialog" />

</body>

<p:dialog widgetVar="dialogExpirationSession" modal="true" closable="false" resizable="false" draggable="false">
	<h:form>
		<h:outputText value="Votre session est expirée" />
		<p:separator />
		<div align="right">
			<p:commandButton value="Recharger" ajax="false" />
		</div>
	</h:form>
</p:dialog>

</html>